package com.pxmeta.admin.controller;

import com.pxmeta.common.core.domain.AjaxResult;
import com.pxmeta.statistics.bo.UvStatisticResult;
import com.pxmeta.statistics.service.StatisticService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import lombok.SneakyThrows;

/**
 * 统计接口
 *
 * @author shoushen.luan
 * @since 2022-10-20
 */
@RestController
@RequestMapping("/statistic")
@CrossOrigin
public class StatisticController {
    @Autowired
    private StatisticService statisticService;

    /**
     * 获取uv统计列表
     *
     * @return
     */
    @SneakyThrows
    @RequestMapping(value = "/getUvList")
    public AjaxResult<List<UvStatisticResult>> getUvList() {
        return AjaxResult.success(statisticService.getStatList());
    }
}
